package net.tv90.bfmccore.util.HUD;

import lombok.Data;
import net.tv90.bfmccore.util.vector.Vector2i;

import java.util.Objects;

@Data
public class Text {
    private Vector2i textPos;
    private String content;
    private double textScale;
    private String name;
    public Text() {
        this.textPos = new Vector2i(-1, -1);
        this.content = "Text";
        this.textScale = 1.0D;
        this.name = "Text";
    }

    public Text(Vector2i textPos, String content, double textScale) {
        this.textPos = textPos;
        this.content = content;
        this.textScale = textScale;
    }

    public Text(Vector2i textPos, String content, double textScale,String name) {
        this.textPos = textPos;
        this.content = content;
        this.textScale = textScale;
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Text)) return false;
        Text text = (Text) o;
        return Double.compare(text.textScale, textScale) == 0 && Objects.equals(textPos, text.textPos) && Objects.equals(content, text.content) && Objects.equals(name, text.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(textPos, content, textScale, name);
    }
}
